#ifndef _INTEGRATION_H_
#define _INTEGRATION_H_

namespace tools {

  class SysModel {

  protected:
    int     integration_mode;
    int     dim;
    int     udim;
    int     num_integration_steps;
    double  delta_t;


    void rkdumb(const double * vstart, double t_start, double t_stop, int n, double * vend, const double *u);
    
    void rk4(const double * y, const double * dydx, double x, double interval, double * yout, const double *u);

    /** The derivative dgl defining the system. 
     * Implement your system here. An MDP should not depend on the variable x (time invariant). 
     */
    virtual void derivs(double t, const double *x, double *dxdt, const double *u)=0;

  public:
    SysModel(int _dim, double _delta_t, int _num_integration_steps, int _integration_mode, int _udim);
    virtual ~SysModel();
    
    /** System dgl for MDP */
    bool nextState(const double * state, const double * action, double * nextState);
    
    /** System dgl for non MDP dynamic systems */
    bool nextState(double t, const double * state, const double * action, double * nextState);

  };
}

#endif
